- Part 0: A little bit of set up!
- Part 1: reading in manually (point and click)
- Part 2: reading in directly, reading XLSX file (Excel file), other data inputs
- Part 3: working directories, relative vs. absolute paths
We will cover Output a bit later!
We will cover Output a bit later!
Let’s make an R Project so we can stay organized in the next steps.
Click the new R Project button at the top left of RStudio:
In the New Project Wizard, click “New Directory”:
Click “New Project”:
Type in a name for your new folder.
Store it somewhere easy to find, such as your Desktop:
You now have a new R Project folder on your Desktop!
Make sure you add any scripts or data files to this folder as we go through today’s lesson. This will make sure R is able to “find” your files.
jhur packageYouth Tobacco Survey (YTS) dataset:
“The YTS was developed to provide states with comprehensive data on both middle school and high school students regarding tobacco use, exposure to environmental tobacco smoke, smoking cessation, school curriculum, minors’ ability to purchase or otherwise obtain tobacco products, knowledge and attitudes about tobacco, and familiarity with pro-tobacco and anti-tobacco media messages.”
Dataset is located at http://jhudatascience.org/intro_to_r/data/Youth_Tobacco_Survey_YTS_Data.csv
Download data by clicking the above link
File Import Dataset From Text (
readr) paste the url (http://jhudatascience.org/intro_to_r/data/Youth_Tobacco_Survey_YTS_Data.csv) click “Update” and “Import”